package com.ksyun.campus.client.util;

import org.apache.commons.codec.digest.DigestUtils;

import java.io.ByteArrayInputStream;
import java.io.IOException;
import java.io.InputStream;

public class MD5Util {
    
    public static String calculateMD5(byte[] data) {
        return DigestUtils.md5Hex(data);
    }
    
    public static String calculateMD5(InputStream inputStream) throws IOException {
        return DigestUtils.md5Hex(inputStream);
    }
    
    public static String calculateMD5(String data) {
        return DigestUtils.md5Hex(data);
    }
}
